<!-- invoice 页面内容 -->
<section class="invoice" ng-controller="invoiceCtrl">
    <div class="row margin-reset step-row">
        <div class="panel yf-shadow">
            <div class="panel-heading">
                <h4>申请发票流程</h4>
                <div class="row margin-reset">
                    <div class="col-md-3 col-sm-6 col-xs-6 step-col padding-reset">
                        <div class="step-tip yf-shadow">1</div>
                        <div class="step-info">点击申请发票</div>
                    </div>
                    <div class="col-md-3 col-sm-6 col-xs-6 step-col padding-reset">
                        <div class="step-tip yf-shadow">2</div>
                        <div class="step-info">选择开票订单</div>
                    </div>
                    <div class="col-md-3 col-sm-6 col-xs-6 step-col padding-reset">
                        <div class="step-tip yf-shadow">3</div>
                        <div class="step-info">完善开票信息</div>
                    </div>
                    <div class="col-md-3 col-sm-6 col-xs-6 step-col padding-reset">
                        <div class="step-tip yf-shadow">4</div>
                        <div class="step-info">提交发票申请</div>
                    </div>
                </div>
            </div>
            <div class="panel-body">
                <div class="text-center">
                    <p>订单服务完成后，根据发票申请，</p>
                    <p>开具发票并递送，发票一经开具，不再支持退款</p>
                    <a ui-sref="mine.newInvoice" class="btn btn-mt-ok">开具发票</a>
                </div>
            </div>
        </div>
    </div>

    <div class="row margin-reset table-row">
        <div class="col-sm-12 col-xs-12">
            <p>
                <h4>开票历史</h4>
            </p>
        </div>
        <table class="table table-bordered yf-shadow">
            <thead>
                <th>发票信息</th>
                <th>收件人信息</th>
                <th>开票信息</th>
                <th>操作</th>
            </thead>
            <tbody>
                <tr ng-repeat="invoice in invoices">
                    <td>
                        <div class="line money">
                            {{ invoice.price | moneyint }}元
                        </div>
                        <div class="line">
                            {{ invoice.company_name }}
                        </div>
                        <div class="line">
                            {{invoice.created_at * 1000 | date:"yyyy-MM-dd HH:mm"}}
                        </div>
                        <div class="line" ng-bind="invoice.invoice_type == 'common'? '普通发票': '增值税发票'">

                        </div>
                    </td>

                    <td>
                        <div class="line">
                            {{invoice.user_invoice.name}}
                        </div>
                        <div class="line">
                            {{invoice.user_invoice.tel}}
                        </div>
                        <div class="line">
                            {{invoice.user_invoice.street}}
                        </div>
                    </td>

                    <td>
                        <div class="line show" ng-bind="invoice.handle_type == 'audit'? '待审核': '已发出'"></div>
                        <div ng-if="invoice.handle_type != 'audit'">
                            <div class="line">
                                交付 {{invoice.express_name}}
                            </div>
                            <div class="line">
                                快递单号：{{invoice.number}}
                            </div>
                            <div class="line expected">
                                预计 {{invoice.express_at | date:'yyyy-MM-dd'}}送达
                            </div>
                        </div>
                    </td>

                    <td>
                        <div class="line">&nbsp;</div>
                        <div class="line show">
                            <a ui-sref="mine.invoiceDetail({id: invoice.id})"> 查看 </a>
                        </div>
                        <!-- <div class="line">
                            <a> 取消 </a>
                        </div> -->
                    </td>
                </tr>
            </tbody>
        </table>
        <nav ng-show="invoices && invoices.length >= 0 && page.total_count > limit">
            <ul class="pager pager-sm yf-pager">
                <li>
                    <a class="btn btn-default" ng-disabled="!((page.current_page - 1) >= 1)" ng-click="getMyInvoices(page.current_page - 1);">上一页</a>
                </li>
                <li>
                    <a class="btn btn-default" ng-disabled="!page.next_page" ng-click="getMyInvoices(page.next_page);">下一页</a>
                </li>
            </ul>
        </nav>
    </div>
</section>
